<template>
  <div id="takeback">  
    <div  style="display:flex;align-items: center;">
          <img class="top_img" src="@/assets/images/a8.png" style="width:35px;height:35px;margin-right:10px;"/>
          <div style="line-height: 40px;font-weight:bold:">回收订单</div>
    </div> 
    <el-form ref="form" :model="form" label-width="70px">  

      <div style="display:flex;">
          <div style="flex:1;display:flex;align-items: center;">
             <div style="width:50px;text-align-last: justify;margin-top:-12px;font-size: 14px;color: #606266;margin-right:10px;">查询项</div>
             

            <el-form-item label="团队长" >
                <el-select  v-model="form.select_num" placeholder="团队长" style="width:140px;" >
                    <el-option  v-for="(item,index) in select_data" :key="index" :label="item.telphone" :value="item.telphone"></el-option>
                </el-select>
             </el-form-item>

            <el-form-item label="手机号" style="margin-left:10px;">
               <el-input v-model="form.telphone" placeholder="手机号"  style="width:140px;"></el-input>
            </el-form-item>

            <div class="buttoon_box">
                <div class="buttoon_box_item"  style="margin-left:10px;background:#FFC600;color:white;" @click="search_but1()">确 定</div>
                <div class="buttoon_box_item" style="margin-left:10px;border:1px solid #D9D9D9;" @click="refresh_but()">清 空</div>    
            </div>
         </div>
         <!-- <div>
              <el-button class="custom_color_button" type="primary" @click="but1()">类别设置</el-button> 
         </div> -->
      </div>


   
   </el-form>
   <!-- 渲染数据list -->
   <takeback-list :datalist="datalist"  @up_list_fun="list_fun"> </takeback-list>

      
   <div style="margin-top:20px;text-align: center;">
      <el-pagination
        background
        @current-change="handleCurrentChange"
        :page-size="10"  
        layout="prev, pager, next, jumper"
        :total="count">
      </el-pagination>
    </div>



      

    

      
  </div>
</template>

<script>
import TakebackList from '@/view/Exchangeorder/TakebackList'
export default {
  name: 'takeback',
  data () {
    return {
        datalist:[],
        page:1,
        count:0,
        form:{
          telphone:'',
          select_num:'',
        },
        select_data:[],
    }
  },
 components:{
    TakebackList
  },
  created(){
     this.list_fun()   
     this.team_fun()
  },
  mounted (){
    
  },
  methods: {
    team_fun(){
     
      this.post("Statistics/listOfLeader", {

	        }).then(res => {

             this.select_data = res.result
           //console.log(res ,"6265465")
         })
    },
       list_fun(){
          this.post("/rogue/listOfMember", {
              page:this.page,
              team_telphone:this.form.select_num,
              telphone:this.form.telphone,
	        }).then(res => {
            this.count = res.result.count
            this.datalist = res.result.list
            console.log(res)
         })
      },

      search_but1(){
        this.page = 1
        this.list_fun()
      },
      search_but2(){
        this.page = 1
        this.list_fun()
      },
      refresh_but(){
        this.page = 1
        this.form={
          telphone:'',
          select_num:'',
        },
        this.list_fun()
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.page = val
        this.list_fun()
        console.log(`当前页: ${val}`);
      }
  }
}
</script>


<style scoped>
.buttoon_box{
  display:flex;margin-bottom:10px;
}
.buttoon_box_item{
  height:40px;line-height:40px;width:60px;font-size:14px;text-align:center;border-radius:5px;
}
.el-input-box>>>input{
  padding: 0px 3px !important;
}
</style>
